//
//  JXBaseWebView.m
//  JXAddressApp
//
//  Created by huawei.zheng on 2018/12/3.
//  Copyright © 2018 zhhw_home. All rights reserved.
//

#import "JXBaseWebView.h"

@interface JXBaseWebView()

@property (nonatomic, strong) WKWebViewConfiguration *webViewConfiguration;

@end



@implementation JXBaseWebView

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        

        if (@available(iOS 11.0, *)) {
            self.webView.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
        }
        
        _webViewConfiguration = [[WKWebViewConfiguration alloc] init];
        _webView = [[WKWebView alloc] initWithFrame:CGRectZero configuration:self.webViewConfiguration];
        [self addSubview:_webView];
        
        _webView.frame = self.bounds;
 
    }
    
    return self;
}

- (void)setWebUrl:(NSURL *)webUrl
{
    _webUrl = webUrl;
    NSURLRequest *request = [NSURLRequest requestWithURL:self.webUrl];
    [self.webView loadRequest:request];
}

@end
